package com.lier.gulimall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liyd
 * @description
 * @date 2025/7/2 11:55
 */
@Configuration
public class MyRedissonConfig {


    @Bean(destroyMethod = "shutdown")
    public RedissonClient getRedissonClient(){
        Config config = new Config();
//        config.useClusterServers().addNodeAddress("192.168.6.188:6379").setPassword("J4WYB0lqYEnx1tWDLpuN");
        config.useSingleServer().setAddress("redis://192.168.6.188:6379").setPassword("J4WYB0lqYEnx1tWDLpuN");
        return Redisson.create(config);
    }
}
